/**
 * @ author: 汪孟苹
 */
define(["jquery","bbcare"],function($,$bb){
	var servers = {};
	var URL = $bb.baseUrl("followup");

	/* 请求顶部和底部的统计数据 */
	servers.ajaxStatis = function(callback){
		$bb.ajax({
			url: URL + "followup/service/patient/patientQueueStatisticsQuery",
			data:JSON.stringify({
				data : {
					"schemeBusiType":1
				}
			}),
			success: function(data){
				if(data.success){
					callback(data.data);
				}else{
					$bb.toastShow(data.msg ? data.msg : "请求统计数据出错！");
				}	
			}
		});
	}; 
	/* 请求队列selectQueue */
	servers.ajaxQueue = function(callback){
		$bb.ajax({
			url: URL + "followup/service/queue/followQueueListQuery",
			success: function(data){
				if(data.success){
					callback(data.data.rows);
				}else{
					$bb.toastShow(data.msg ? data.msg : "请求队列出错！");
				}
			}
		});
	}
	/* 请求今日门诊记录 */
	servers.ajaxPatientsOperate = function(params,callback){
		$bb.ajax({
			url: URL + "followup/service/patient/patientOperateListQuery",
			data:JSON.stringify({
				data : params
			}),
			success: function(data){
				if(data.success){
					callback(data.data.rows);
				}else{
					$bb.toastShow(data.msg ? data.msg : "请求今日门诊记录出错！");
				}	
			}
		});
	}
	/* 请求全部患者 */
	servers.ajaxPatientsQueue = function(params,callback){
		$bb.ajax({
			url: URL + "followup/service/patient/patientQueueListQuery",
			data:JSON.stringify({	
				data : params
			}),
			success: function(data){
				if(data.success){
					callback(data.data,params);
				}else{
					$bb.toastShow(data.msg ? data.msg : "请求窗口期随访患者出错！");
				}	
				$("#patientOperateListQuery").css({"height": $("#windowBabyList").height() + $(".ws-bottom-left-bottom").height() + 'px'});
			}
		});
	}
	return servers;
});